﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class PhysicsExtend
{
    public static int BoxCastNonAllocEx(float cx, float cy, float cz, float halfExtentX, float halfExtentY, float halfExtentZ, float directionX, float directionY, float directionZ, RaycastHit[] results, float ox, float oy, float oz, float ow, float distance, int layerMask, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
    {
        Vector3 center = new Vector3(cx, cy, cz);
        Vector3 halfExtent = new Vector3(halfExtentX, halfExtentY, halfExtentZ);
        Vector3 direction = new Vector3(directionX, directionY, directionZ);
        Quaternion orientation = new Quaternion(ox, oy, oz, ow);

        return UnityEngine.Physics.BoxCastNonAlloc(center, halfExtent, direction, results, orientation, distance, layerMask, queryTriggerInteraction);
    }

    public static int BoxCastNonAllocEx(float cx, float cy, float cz, float halfExtentX, float halfExtentY, float halfExtentZ, float directionX, float directionY, float directionZ, RaycastHit[] results, Transform t, float distance, int layerMask, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
    {
        Vector3 center = new Vector3(cx, cy, cz);
        Vector3 halfExtent = new Vector3(halfExtentX, halfExtentY, halfExtentZ);
        Vector3 direction = new Vector3(directionX, directionY, directionZ);
        Quaternion orientation = t.rotation;

        return UnityEngine.Physics.BoxCastNonAlloc(center, halfExtent, direction, results, orientation, distance, layerMask, queryTriggerInteraction);
    }
}
